home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / LayerMenu.mel1 < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.2 KB  |  134 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  28 June 1996
  22. // Author:         jb
  23. //
  24. //
  25. //  Procedure Name:
  26. //      LayerMenu
  27. //
  28. //  Description:
  29. //        This procedure creates a Layer menu in the
  30. //        main menubar.  It controls things like
  31. //        creating/deleting/hiding/showing of layers.
  32. //
  33. //  Input Arguments:
  34. //      Parent to attach the menu to.
  35. //
  36. //  Return Value:
  37. //      None.
  38. //
  39.     
  40. global proc LayerMenu( string $parent ) {
  41.  
  42.     global int $gHideLayerSetting;
  43.     global int $gTemplateLayerSetting;
  44.  
  45.     setParent -m $parent;
  46.  
  47.     if( `menu -q -ni $parent` == 0 ) {
  48.  
  49.         //    Build the menu items
  50.  
  51.         menuItem -l "New Layer..."
  52.             -annotation "New Layer: Create a new layer"
  53.             -c "createNewLayer"; 
  54.         menuItem -l "Rename Layer..."
  55.             -annotation "Rename Layer: Rename the current layer"
  56.             -c "editLayerName"; 
  57.         menuItem -l "Remove Current Layer"
  58.             -annotation "Remove Current Layer: Remove the current layer"
  59.             -c "removeCurrentLayer";
  60.         menuItem -l "Layer Editor..."
  61.             -annotation "Layer Editor Window: Open the layer editor window"
  62.             -c "layerEditorWin";
  63.  
  64.         menuItem -divider true;
  65.  
  66.         menuItem -l "Transfer to Layer"
  67.             -annotation "Transfer To Layer: Move selected items to the current layer"
  68.             -c "transferToLayer";
  69.         menuItem -l "Select All on Layer"
  70.             -annotation "Select All on Layer: Select the contents of the current layer"
  71.             -c "selectAllLayer";
  72.  
  73.         menuItem -divider true;
  74.  
  75.         menuItem -l "Hide Layer"
  76.             -annotation "Hide Layer: Hide the contents of the current layer"
  77.             -c "hideShowLayer -active hide";
  78.         menuItem -l "Hide All Layers"
  79.             -annotation "Hide All Layers: Hide the contents of all layers"
  80.             -c "hideShowLayer -all hide";
  81.  
  82.         menuItem -divider true;
  83.  
  84.         menuItem -l "Show Layer"
  85.             -annotation "Show Layer: Display the contents of the current layer" -c "hideShowLayer -active showHidden";
  86.         menuItem -l "Show All Layers"
  87.             -annotation "Show All Layers: Display the contents of all layers"
  88.             -c "hideShowLayer -all showHidden";
  89.  
  90.         menuItem -divider true;
  91.  
  92.         menuItem -l "Template Layer"
  93.             -annotation "Template Layer: Template the contents of the current layer"
  94.             -c "templateLayer -active 1";
  95.         menuItem -l "Untemplate Layer"
  96.             -annotation "Untemplate Layer: Untemplate the contents of the current layer"            
  97.             -c "templateLayer -active 0";
  98.  
  99.         menuItem -divider true;
  100.  
  101.         menuItem -cb $gHideLayerSetting
  102.             -annotation "Hide Inactive Layers: Hide the contents of all layers except the current layer"
  103.             -l "Hide Inactive Layers" 
  104.             -c "updateLayerStates -hide (!$gHideLayerSetting)"
  105.             hideNonCurrentLayersItem;
  106.  
  107.         menuItem -cb $gTemplateLayerSetting
  108.             -annotation "Template Inactive Layers: Template the contents of all layers except the current layer"
  109.             -l "Template Inactive Layers" 
  110.             -c "updateLayerStates -template (!$gTemplateLayerSetting)"
  111.             templateNonCurrentLayersItem;
  112.  
  113.         // Create a scripJob that is triggered
  114.         // when something is added/remove/changed in the
  115.         // layer partition, so that the layer UI updates
  116.         // automatically.
  117.         //
  118.         scriptJob -p $parent -e "layerPartitionModified" "updateLayerUI";
  119.  
  120.     } else {
  121.         //
  122.         //  Set the state of check items
  123.         //
  124.         menuItem -e 
  125.             -cb $gHideLayerSetting 
  126.             ($parent+"|hideNonCurrentLayersItem");
  127.  
  128.         menuItem -e 
  129.             -cb $gTemplateLayerSetting 
  130.             ($parent+"|templateNonCurrentLayersItem");
  131.  
  132.     }
  133. }
  134.